import Trade from "./Trade.js?t=a"

export default {
props:['entity'] ,
data(){return {
}},components:{Trade},
template:`

<tr class="bgroup" @click="currentIndex = index">
                        <td>{{index+1}}</td>

                        <td>
                            <select v-if="currentIndex == index" v-model="entity.produceType">
                                <option v-for="o in producerList" :value="o.produceCode">{{o.name}}</option>
                            </select>
                            <span v-else>{{getProducer(entity.produceType)?.name}} </span>
                        </td>

                        <td>
                            <select v-if="currentIndex == index" v-model="entity.texture">
                                <option v-for="o in textureList">{{o.name}}</option>
                            </select>
                            <span v-else>{{entity.texture}} </span>
                        </td>

                        <td>
                            <select v-if="currentIndex == index" v-model="entity.lamination">
                                <option v-for="o in postprocessingList">{{o.name}}</option>
                            </select>
                            <span v-else>{{entity.lamination}} </span>
                        </td>

                        <td><input type="number" step="1" min="1" v-if="currentIndex == index" v-model="entity.width"/>
                            <span v-else>{{entity.width}} </span>
                        </td>
                        <td><input type="number" step="1" min="1" v-if="currentIndex == index" v-model="entity.height"/>
                            <span v-else>{{entity.height}} </span>
                        </td>
                        <td><input type="number" step="1" min="1" v-if="currentIndex == index"
                                   v-model="entity.maxColumns"/>
                            <span v-else>{{entity.maxColumns}} </span>
                        </td>
                        <td><input type="number" step="1" min="1" v-if="currentIndex == index"
                                   v-model="entity.maxRows"/>
                            <span v-else>{{entity.maxRows}} </span>
                        </td>


                        <td>
                            <select v-if="currentIndex == index" v-model="entity.status">
                                <option value="0">未启用</option>
                                <option value="1">已启用</option>
                            </select>
                            <label v-else>{{entity.status==1?"已启用":"未启用"}}</label>

                        </td>

                        <td>
                            <span v-if="currentIndex == index"><input v-model="entity.intro"/> </span>
                            <span v-else>{{entity.intro}} </span>
                        </td>
                        <td>

                            <button @click="submit(index)">保存</button>
                        </td>
</tr>
`
}
